using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace TN_CMS.Domain.Entities
{
    public class SysAdmin
    {
        public SysAdmin()
        {
            SysRoles = new HashSet<SysRole>();
            CreatedByMe = new HashSet<SysAdmin>();
            UpdatedByMe = new HashSet<SysAdmin>();
        }

        [ScaffoldColumn(false)]
        public int Id { get; set; }

        [Required]
        [UIHint("TNText")]
        public string Name { get; set; }

        [Required]
        [UIHint("TNText")]
        public string Email { get; set; }

        [UIHint("TNPassword")]
        public string Password { get; set; }

        [Required]
        [UIHint("TNDisplayText")]
        [Display(Name = "Created On")]
        public DateTime CreatedOn { get; set; }

        [ScaffoldColumn(false)]
        public int? CreatedBy { get; set; }

        public virtual SysAdmin CreateAdmin { get; set; }

        public virtual ICollection<SysAdmin> CreatedByMe { get; set; }

        [UIHint("TNDisplayText")]
        [Display(Name = "Updated On")]
        public DateTime? UpdatedOn { get; set; }

        [ScaffoldColumn(false)]
        public int? UpdatedBy { get; set; }

        public virtual SysAdmin UpdateAdmin { get; set; }

        public virtual ICollection<SysAdmin> UpdatedByMe { get; set; }

        [UIHint("TNCheckBox")]
        [Display(Name = "Is Active")]
        public bool IsActive { get; set; }

        [ScaffoldColumn(false)]
        public string RecoverCode { get; set; }

        [ScaffoldColumn(false)]
        public DateTime? RecoverOn { get; set; }

        public virtual ICollection<SysRole> SysRoles { get; set; }

        [NotMapped]
        [Display(Name = "Roles")]
        public List<int> LstRole { get; set; }

        public virtual ICollection<News> NewsCreatedByMe { get; set; }
    }
}
